package com.gulimall.seckill.controller;

import com.gulimall.api.domain.CouponDTO;
import com.gulimall.api.feign.CouponClient;
import com.gulimall.common.core.domain.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/seckill/test")
public class SeckillController {
    @Resource
    private CouponClient couponClient;

    /**
     * 获取优惠券信息
     */
    @GetMapping("/coupon")
    public Result getCouponInfo() {
        CouponDTO couponDTO = couponClient.getCouponDTO();
        return Result.ok(couponDTO);
    }
}
